package Stream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Copy{
    public static void main(String[] args) throws Exception{
        File f1 = new File("d:/xxx.txt");
        File f2 = new File("d:/xxx1.txt");
        FileInputStream fis = new FileInputStream(f1);
        FileOutputStream fos = new FileOutputStream(f2);
        byte[] datas = new byte[12040];
        System.out.println("begin");
        while(true){
            int len = fis.read(datas);
            if(len>0){
                fos.write(datas,0,len);
            }
            else{
                break;
            }
        }
        System.out.println("end");
        fis.close();
        fos.close();
    }
}
